// SPDX-FileCopyrightText: 2024 Ondsel <development@ondsel.com>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

import {StringEnum, Type} from "@feathersjs/typebox";

// pulled and rewritten from https://github.com/ourworldincode/currency

export const currencyNameMap = {
  AED: "Dirhams",
  AFN: "Afghani",
  ALL: "Lekë",
  AMD: "Dram",
  ANG: "Guilders",
  AOA: "Kwanza",
  ARS: "Pesos",
  AUD: "Dollars",
  AWG: "Florin",
  AZN: "Manat",
  BAM: "Marks",
  BBD: "Dollars",
  BDT: "Taka",
  BGN: "Leva",
  BHD: "Dinars",
  BIF: "Francs",
  BMD: "Dollars",
  BND: "Dollars",
  BOB: "Bolivianos",
  BRL: "Reais",
  BSD: "Dollars",
  BTN: "Ngultrums",
  BWP: "Pula",
  BYN: "Rubles",
  BZD: "Dollars",
  CAD: "Dollars",
  CDF: "Francs",
  CHF: "Francs",
  CKD: "Dollars",
  CLP: "Pesos",
  CNY: "Yuan",
  COP: "Pesos",
  CRC: "Colones",
  CUC: "Pesos",
  CUP: "Pesos",
  CVE: "Escudo",
  CZK: "Koruny",
  DJF: "Francs",
  DKK: "Kroner",
  DOP: "Pesos",
  DZD: "Dinars",
  EGP: "Pounds",
  EHP: "Pesetas",
  ERN: "Nakfa",
  ETB: "Birr",
  EUR: "Euros",
  FJD: "Dollars",
  FKP: "Pounds",
  FOK: "Krónas",
  GBP: "Pounds",
  GEL: "Lari",
  GGP: "Pounds",
  GHS: "Cedis",
  GIP: "Pounds",
  GMD: "Dalasis",
  GNF: "Francs",
  GTQ: "Quetzales",
  GYD: "Dollars",
  HKD: "Dollars",
  HNL: "Lempiras",
  HRK: "Kuna",
  HTG: "Gourdes",
  HUF: "Forint",
  IDR: "Rupiah",
  ILS: "Shekels",
  IMP: "Pounds",
  INR: "Rupees",
  IQD: "Dinars",
  IRR: "Rials",
  ISK: "Krónur",
  JEP: "Pounds",
  JMD: "Dollars",
  JOD: "Dinars",
  JPY: "Yen",
  KES: "Shillings",
  KGS: "Som",
  KHR: "Riels",
  KID: "Dollars",
  KMF: "Francs",
  KPW: "Won",
  KRW: "Won",
  KWD: "Dinars",
  KYD: "Dollars",
  KZT: "Tenge",
  LAK: "Kip",
  LBP: "Pounds",
  LKR: "Rupees",
  LRD: "Dollars",
  LSL: "maLoti",
  LYD: "Dinars",
  MAD: "Dirhams",
  MDL: "Lei",
  MGA: "Ariary",
  MKD: "Denars",
  MMK: "Kyat",
  MNT: "Tögrög",
  MOP: "Patacas",
  MRU: "Ouguiya",
  MUR: "Rupees",
  MVR: "Rufiyaa",
  MWK: "Kwacha",
  MXN: "Pesos",
  MYR: "Ringgit",
  MZN: "Meticais",
  NAD: "Dollars",
  NGN: "Naira",
  NIO: "Córdoba Oro",
  NOK: "Kroner",
  NPR: "Rupees",
  NZD: "Dollars",
  OMR: "Rials",
  PAB: "Balboa",
  PEN: "Soles",
  PGK: "Kina",
  PHP: "Pesos",
  PKR: "Rupees",
  PLN: "Zlotys",
  PND: "Dollars",
  PRB: "Rubles",
  PYG: "Guaraníes",
  QAR: "Riyals",
  RON: "Lei",
  RSD: "Dinars",
  RUB: "Rubles",
  RWF: "Francs",
  SAR: "Riyals",
  SBD: "Dollars",
  SCR: "Rupees",
  SDG: "Pounds",
  SEK: "Kronor",
  SGD: "Dollars",
  SHP: "Pounds",
  SLL: "Leones",
  SLS: "Shillings",
  SOS: "Shillings",
  SRD: "Dollars",
  SSP: "Pounds",
  STN: "Dobras",
  SVC: "Colones",
  SYP: "Pounds",
  SZL: "Emalangeni",
  THB: "Baht",
  TJS: "Somoni",
  TMT: "Manat",
  TND: "Dinars",
  TOP: "Pa'anga",
  TRY: "Lira",
  TTD: "Dollars",
  TVD: "Dollars",
  TWD: "Dollars",
  TZS: "Shillings",
  UAH: "Hryvnias",
  UGX: "Shillings",
  USD: "Dollars",
  UYU: "Pesos",
  UZS: "Som",
  VED: "Bolívars Digital",
  VES: "Bolívares",
  VND: "Dong",
  VUV: "Vatu",
  WST: "Tala",
  XAF: "Francs",
  XCD: "Dollars",
  XOF: "Francs",
  XPF: "Francs",
  YER: "Rials",
  ZAR: "Rand",
  ZMW: "Kwacha",
  ZWB: "Dollars",
  ZWL: "Dollars",
}
export const currencySymbolMap = {
  AED: "د.إ.",
  AFN: "؋",
  ALL: "L",
  AMD: "դր",
  ANG: "ƒ",
  AOA: "Kz",
  ARS: "$",
  AUD: "$",
  AWG: "ƒ",
  AZN: "₼",
  BAM: "КМ",
  BBD: "$",
  BDT: "৳",
  BGN: "лв.",
  BHD: "د.ب.",
  BIF: "FBu",
  BMD: "$",
  BND: "$",
  BOB: "Bs.",
  BRL: "R$",
  BSD: "$",
  BTN: "Nu.",
  BWP: "P",
  BYN: "руб.",
  BZD: "$",
  CAD: "$",
  CDF: "₣",
  CHF: "₣",
  CKD: "$",
  CLP: "$",
  CNY: "¥元",
  COP: "$",
  CRC: "₡",
  CUC: "$",
  CUP: "₱",
  CVE: "$",
  CZK: "Kč",
  DJF: "ف.ج.",
  DKK: "kr.",
  DOP: "$",
  DZD: "د.ج.",
  EGP: "ج.م.",
  EHP: "Ptas.",
  ERN: "ناكفا",
  ETB: "ብር",
  EUR: "€",
  FJD: "$",
  FKP: "£",
  FOK: "kr",
  GBP: "£",
  GEL: "₾",
  GGP: "£",
  GHS: "₵",
  GIP: "£",
  GMD: "D",
  GNF: "FG",
  GTQ: "$",
  GYD: "$",
  HKD: "$",
  HNL: "L",
  HRK: "kn",
  HTG: "G",
  HUF: "Ft",
  IDR: "Rp",
  ILS: "₪",
  IMP: "£",
  INR: "₹",
  IQD: "د.ع.",
  IRR: "﷼",
  ISK: "kr",
  JEP: "£",
  JMD: "$",
  JOD: "د.أ.",
  JPY: "¥",
  KES: "KSh",
  KGS: "с",
  KHR: "៛",
  KID: "$",
  KMF: "CF",
  KPW: "₩",
  KRW: "₩",
  KWD: "د.ك.",
  KYD: "$",
  KZT: "₸",
  LAK: "₭",
  LBP: "ل.ل.",
  LKR: "රු or ரூ",
  LRD: "$",
  LSL: "L",
  LYD: "ل.د.",
  MAD: "د.م.",
  MDL: "L",
  MGA: "Ar",
  MKD: "ден",
  MMK: "Ks",
  MNT: "₮",
  MOP: "MOP$",
  MRU: "أ.م.",
  MUR: "रु ",
  MVR: ".ރ",
  MWK: "MK",
  MXN: "$",
  MYR: "RM",
  MZN: "MT",
  NAD: "$",
  NGN: "₦",
  NIO: "C$",
  NOK: "kr",
  NPR: "रू",
  NZD: "$",
  OMR: "ر.ع.",
  PAB: "B/.",
  PEN: "S/.",
  PGK: "K",
  PHP: "₱",
  PKR: "Rs",
  PLN: "zł",
  PND: "$",
  PRB: "р.",
  PYG: "₲",
  QAR: "ر.ق.",
  RON: "L",
  RSD: "дин",
  RUB: "₽",
  RWF: "R₣",
  SAR: "ر.س.",
  SBD: "$",
  SCR: "Rs",
  SDG: "ج.س.",
  SEK: "kr",
  SGD: "$",
  SHP: "£",
  SLL: "Le",
  SLS: "Sl",
  SOS: "Ssh",
  SRD: "$",
  SSP: "SS£",
  STN: "Db",
  SVC: "₡",
  SYP: "ل.س.",
  SZL: "L",
  THB: "฿",
  TJS: "SM",
  TMT: "T",
  TND: "د.ت.",
  TOP: "PT",
  TRY: "₺",
  TTD: "$",
  TVD: "$",
  TWD: "圓",
  TZS: "TSh",
  UAH: "грн",
  UGX: "Sh",
  USD: "$",
  UYU: "$",
  UZS: "сум",
  VED: "Bs.",
  VES: "Bs.F",
  VND: "₫",
  VUV: "VT",
  WST: "ST",
  XAF: "Fr.",
  XCD: "$",
  XOF: "₣",
  XPF: "₣",
  YER: "ر.ي.",
  ZAR: "R",
  ZMW: "ZK",
  ZWB: "",
  ZWL: "$",
}
export const currencyTypeMap = {
  AED: 'AED',
  AFN: 'AFN',
  ALL: 'ALL',
  AMD: 'AMD',
  ANG: 'ANG',
  AOA: 'AOA',
  ARS: 'ARS',
  AUD: 'AUD',
  AWG: 'AWG',
  AZN: 'AZN',
  BAM: 'BAM',
  BBD: 'BBD',
  BDT: 'BDT',
  BGN: 'BGN',
  BHD: 'BHD',
  BIF: 'BIF',
  BMD: 'BMD',
  BND: 'BND',
  BOB: 'BOB',
  BRL: 'BRL',
  BSD: 'BSD',
  BTN: 'BTN',
  BWP: 'BWP',
  BYN: 'BYN',
  BZD: 'BZD',
  CAD: 'CAD',
  CDF: 'CDF',
  CHF: 'CHF',
  CKD: 'CKD',
  CLP: 'CLP',
  CNY: 'CNY',
  COP: 'COP',
  CRC: 'CRC',
  CUC: 'CUC',
  CUP: 'CUP',
  CVE: 'CVE',
  CZK: 'CZK',
  DJF: 'DJF',
  DKK: 'DKK',
  DOP: 'DOP',
  DZD: 'DZD',
  EGP: 'EGP',
  EHP: 'EHP',
  ERN: 'ERN',
  ETB: 'ETB',
  EUR: 'EUR',
  FJD: 'FJD',
  FKP: 'FKP',
  FOK: 'FOK',
  GBP: 'GBP',
  GEL: 'GEL',
  GGP: 'GGP',
  GHS: 'GHS',
  GIP: 'GIP',
  GMD: 'GMD',
  GNF: 'GNF',
  GTQ: 'GTQ',
  GYD: 'GYD',
  HKD: 'HKD',
  HNL: 'HNL',
  HRK: 'HRK',
  HTG: 'HTG',
  HUF: 'HUF',
  IDR: 'IDR',
  ILS: 'ILS',
  IMP: 'IMP',
  INR: 'INR',
  IQD: 'IQD',
  IRR: 'IRR',
  ISK: 'ISK',
  JEP: 'JEP',
  JMD: 'JMD',
  JOD: 'JOD',
  JPY: 'JPY',
  KES: 'KES',
  KGS: 'KGS',
  KHR: 'KHR',
  KID: 'KID',
  KMF: 'KMF',
  KPW: 'KPW',
  KRW: 'KRW',
  KWD: 'KWD',
  KYD: 'KYD',
  KZT: 'KZT',
  LAK: 'LAK',
  LBP: 'LBP',
  LKR: 'LKR',
  LRD: 'LRD',
  LSL: 'LSL',
  LYD: 'LYD',
  MAD: 'MAD',
  MDL: 'MDL',
  MGA: 'MGA',
  MKD: 'MKD',
  MMK: 'MMK',
  MNT: 'MNT',
  MOP: 'MOP',
  MRU: 'MRU',
  MUR: 'MUR',
  MVR: 'MVR',
  MWK: 'MWK',
  MXN: 'MXN',
  MYR: 'MYR',
  MZN: 'MZN',
  NAD: 'NAD',
  NGN: 'NGN',
  NIO: 'NIO',
  NOK: 'NOK',
  NPR: 'NPR',
  NZD: 'NZD',
  OMR: 'OMR',
  PAB: 'PAB',
  PEN: 'PEN',
  PGK: 'PGK',
  PHP: 'PHP',
  PKR: 'PKR',
  PLN: 'PLN',
  PND: 'PND',
  PRB: 'PRB',
  PYG: 'PYG',
  QAR: 'QAR',
  RON: 'RON',
  RSD: 'RSD',
  RUB: 'RUB',
  RWF: 'RWF',
  SAR: 'SAR',
  SBD: 'SBD',
  SCR: 'SCR',
  SDG: 'SDG',
  SEK: 'SEK',
  SGD: 'SGD',
  SHP: 'SHP',
  SLL: 'SLL',
  SLS: 'SLS',
  SOS: 'SOS',
  SRD: 'SRD',
  SSP: 'SSP',
  STN: 'STN',
  SVC: 'SVC',
  SYP: 'SYP',
  SZL: 'SZL',
  THB: 'THB',
  TJS: 'TJS',
  TMT: 'TMT',
  TND: 'TND',
  TOP: 'TOP',
  TRY: 'TRY',
  TTD: 'TTD',
  TVD: 'TVD',
  TWD: 'TWD',
  TZS: 'TZS',
  UAH: 'UAH',
  UGX: 'UGX',
  USD: 'USD',
  UYU: 'UYU',
  UZS: 'UZS',
  VED: 'VED',
  VES: 'VES',
  VND: 'VND',
  VUV: 'VUV',
  WST: 'WST',
  XAF: 'XAF',
  XCD: 'XCD',
  XOF: 'XOF',
  XPF: 'XPF',
  YER: 'YER',
  ZAR: 'ZAR',
  ZMW: 'ZMW',
  ZWB: 'ZWB',
  ZWL: 'ZWL',
};
export const CurrencyType = StringEnum([
  currencyTypeMap.AED,
  currencyTypeMap.AFN,
  currencyTypeMap.ALL,
  currencyTypeMap.AMD,
  currencyTypeMap.ANG,
  currencyTypeMap.AOA,
  currencyTypeMap.ARS,
  currencyTypeMap.AUD,
  currencyTypeMap.AWG,
  currencyTypeMap.AZN,
  currencyTypeMap.BAM,
  currencyTypeMap.BBD,
  currencyTypeMap.BDT,
  currencyTypeMap.BGN,
  currencyTypeMap.BHD,
  currencyTypeMap.BIF,
  currencyTypeMap.BMD,
  currencyTypeMap.BND,
  currencyTypeMap.BOB,
  currencyTypeMap.BRL,
  currencyTypeMap.BSD,
  currencyTypeMap.BTN,
  currencyTypeMap.BWP,
  currencyTypeMap.BYN,
  currencyTypeMap.BZD,
  currencyTypeMap.CAD,
  currencyTypeMap.CDF,
  currencyTypeMap.CHF,
  currencyTypeMap.CKD,
  currencyTypeMap.CLP,
  currencyTypeMap.CNY,
  currencyTypeMap.COP,
  currencyTypeMap.CRC,
  currencyTypeMap.CUC,
  currencyTypeMap.CUP,
  currencyTypeMap.CVE,
  currencyTypeMap.CZK,
  currencyTypeMap.DJF,
  currencyTypeMap.DKK,
  currencyTypeMap.DOP,
  currencyTypeMap.DZD,
  currencyTypeMap.EGP,
  currencyTypeMap.EHP,
  currencyTypeMap.ERN,
  currencyTypeMap.ETB,
  currencyTypeMap.EUR,
  currencyTypeMap.FJD,
  currencyTypeMap.FKP,
  currencyTypeMap.FOK,
  currencyTypeMap.GBP,
  currencyTypeMap.GEL,
  currencyTypeMap.GGP,
  currencyTypeMap.GHS,
  currencyTypeMap.GIP,
  currencyTypeMap.GMD,
  currencyTypeMap.GNF,
  currencyTypeMap.GTQ,
  currencyTypeMap.GYD,
  currencyTypeMap.HKD,
  currencyTypeMap.HNL,
  currencyTypeMap.HRK,
  currencyTypeMap.HTG,
  currencyTypeMap.HUF,
  currencyTypeMap.IDR,
  currencyTypeMap.ILS,
  currencyTypeMap.IMP,
  currencyTypeMap.INR,
  currencyTypeMap.IQD,
  currencyTypeMap.IRR,
  currencyTypeMap.ISK,
  currencyTypeMap.JEP,
  currencyTypeMap.JMD,
  currencyTypeMap.JOD,
  currencyTypeMap.JPY,
  currencyTypeMap.KES,
  currencyTypeMap.KGS,
  currencyTypeMap.KHR,
  currencyTypeMap.KID,
  currencyTypeMap.KMF,
  currencyTypeMap.KPW,
  currencyTypeMap.KRW,
  currencyTypeMap.KWD,
  currencyTypeMap.KYD,
  currencyTypeMap.KZT,
  currencyTypeMap.LAK,
  currencyTypeMap.LBP,
  currencyTypeMap.LKR,
  currencyTypeMap.LRD,
  currencyTypeMap.LSL,
  currencyTypeMap.LYD,
  currencyTypeMap.MAD,
  currencyTypeMap.MDL,
  currencyTypeMap.MGA,
  currencyTypeMap.MKD,
  currencyTypeMap.MMK,
  currencyTypeMap.MNT,
  currencyTypeMap.MOP,
  currencyTypeMap.MRU,
  currencyTypeMap.MUR,
  currencyTypeMap.MVR,
  currencyTypeMap.MWK,
  currencyTypeMap.MXN,
  currencyTypeMap.MYR,
  currencyTypeMap.MZN,
  currencyTypeMap.NAD,
  currencyTypeMap.NGN,
  currencyTypeMap.NIO,
  currencyTypeMap.NOK,
  currencyTypeMap.NPR,
  currencyTypeMap.NZD,
  currencyTypeMap.OMR,
  currencyTypeMap.PAB,
  currencyTypeMap.PEN,
  currencyTypeMap.PGK,
  currencyTypeMap.PHP,
  currencyTypeMap.PKR,
  currencyTypeMap.PLN,
  currencyTypeMap.PND,
  currencyTypeMap.PRB,
  currencyTypeMap.PYG,
  currencyTypeMap.QAR,
  currencyTypeMap.RON,
  currencyTypeMap.RSD,
  currencyTypeMap.RUB,
  currencyTypeMap.RWF,
  currencyTypeMap.SAR,
  currencyTypeMap.SBD,
  currencyTypeMap.SCR,
  currencyTypeMap.SDG,
  currencyTypeMap.SEK,
  currencyTypeMap.SGD,
  currencyTypeMap.SHP,
  currencyTypeMap.SLL,
  currencyTypeMap.SLS,
  currencyTypeMap.SOS,
  currencyTypeMap.SRD,
  currencyTypeMap.SSP,
  currencyTypeMap.STN,
  currencyTypeMap.SVC,
  currencyTypeMap.SYP,
  currencyTypeMap.SZL,
  currencyTypeMap.THB,
  currencyTypeMap.TJS,
  currencyTypeMap.TMT,
  currencyTypeMap.TND,
  currencyTypeMap.TOP,
  currencyTypeMap.TRY,
  currencyTypeMap.TTD,
  currencyTypeMap.TVD,
  currencyTypeMap.TWD,
  currencyTypeMap.TZS,
  currencyTypeMap.UAH,
  currencyTypeMap.UGX,
  currencyTypeMap.USD,
  currencyTypeMap.UYU,
  currencyTypeMap.UZS,
  currencyTypeMap.VED,
  currencyTypeMap.VES,
  currencyTypeMap.VND,
  currencyTypeMap.VUV,
  currencyTypeMap.WST,
  currencyTypeMap.XAF,
  currencyTypeMap.XCD,
  currencyTypeMap.XOF,
  currencyTypeMap.XPF,
  currencyTypeMap.YER,
  currencyTypeMap.ZAR,
  currencyTypeMap.ZMW,
  currencyTypeMap.ZWB,
  currencyTypeMap.ZWL,
]);
